var Flags=Array();
var Content=Array();
Flags[1]=false;
Content[1]='<table width="187" border="0" align="right" cellpadding="0" cellspacing="6"><tr>' 
           +'<td width="11"><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/administrators/add.php">Add Administrator</a></td></tr>'
           +'<tr><td><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/administrators/view.php">View / Change Administrators</a></td></tr>'
		   +'</table>';
		   
Flags[2]=false;
Content[2]='<table width="187" border="0" align="right" cellpadding="0" cellspacing="6"><tr>' 
           +'<td width="11"><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/affiliates/add.php">Add An Affiliate</a></td></tr>'
           +'<tr><td><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/affiliates/search.php">View / Change Affiliates</a></td></tr>'
           +'<tr><td><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/affiliates/export.php">Export Affiliates</a></td></tr>'
		   +'</table>';

Flags[3]=false;
Content[3]='<table width="187" border="0" align="right" cellpadding="0" cellspacing="6"><tr>' 
           +'<td width="11"><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/distribution/weekly-sale.php">Weekly Sale</a></td></tr>'
           +'<td width="11"><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/distribution/weekly-sale-review.php">Weekly Sale Review</a></td></tr>'
           +'<td width="11"><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/distribution/weekly-sale-history.php">Weekly Sale History</a></td></tr>'
		   +'</table>';

Flags[4]=false;
Content[4]='<table width="187" border="0" align="right" cellpadding="0" cellspacing="6"><tr>' 
           +'<td width="11"><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/reporting/revenue.php">Revenue Report</a></td></tr>'
           +'<tr><td><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/reporting/affiliate.php">Affiliate Report</a></td></tr>'
           +'<tr><td><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/reporting/payment-status.php">Payment Status Report</a></td></tr>'
           +'<tr><td><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/reporting/remittance.php">Remittance Report</a></td></tr>'
		   +'</table>';

Flags[5]=false;
Content[5]='<table width="187" border="0" align="right" cellpadding="0" cellspacing="6"><tr>' 
           +'<td width="11"><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="#">TBA</a></td></tr>'
           +'<tr><td><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="#">TBA</a></td></tr>'
           +'<tr><td><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="#">TBA</a></td></tr>'
		   +'</table>';

Flags[6]=false;
Content[6]='<table width="187" border="0" align="right" cellpadding="0" cellspacing="6"><tr>'
		   +'<td><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/advertisements/add.php">Add Adverts</a></td></tr>' 
           +'<tr><td width="11"><img src="<?=$rootdir?>images/admin/menu-icon.gif" width="11" height="11"></td>'
           +'<td><a href="/admin/advertisements/view.php">View / Change Adverts</a></td></tr>'
		   +'</table>';

function ClearAll(element){
	for(x=1;x<Flags.length;x++){
		if(x!=element){
			var target=document.getElementById("text"+x);
			var targetimage=document.getElementById("image"+x);
			if (target != null) {
				target.innerHTML="";
				Flags[x]=false;
				targetimage.src="<?=$rootdir?>images/admin/menu-icon-plus.gif";
			}
		}
	}
}


function changetext(element){
	ClearAll(element);
	
	var target=document.getElementById("text"+element);
	var targetimage=document.getElementById("image"+element);
	
	if(Flags[element]){
		target.innerHTML="";
		Flags[element]=false;
		targetimage.src="<?=$rootdir?>images/admin/menu-icon-plus.gif";
	}else{
		target.innerHTML=Content[element];
		Flags[element]=true;
		targetimage.src="<?=$rootdir?>images/admin/menu-icon-minus.gif";
	}
}
